<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const allbigArray = [
            { catalogCode: "1", selectArray: [] },
            { catalogCode: "2", selectArray: [] },
            { catalogCode: "3", selectArray: [] },
        ]
        const value = [
            { catalogCode: "1", nam: "狐尾山" },
            { catalogCode: "1", nam: "狐尾山" },
            { catalogCode: "1", nam: "狐尾山" },
            { catalogCode: "1", nam: "狐尾山" },
            { catalogCode: "2", nam: "小生" },
            { catalogCode: "2", nam: "小生" },
            { catalogCode: "2", nam: "小生" },
            { catalogCode: "3", nam: "小三" },
            { catalogCode: "3", nam: "小三" },
        ]
        // value 里面的元素 1保存到allbigArray里面的1的selectArray数组里面去，
        // console.log(allbigArray.selectArray)
        let [a, b, c] = allbigArray
        // console.log(a.selectArray);
        value.map(item => {
            if (item.catalogCode == 1) {
                a.selectArray.push(item)
            }
            if (item.catalogCode == 2) {
                b.selectArray.push(item)
            }
        })
        console.log(allbigArray)
        // value 里面的元素 2保存到allbigArray里面的2的selectArray数组里面去，
    </script>
</body>

</html>